package cn.tedu.apps_system.controller;

import cn.tedu.apps_system.base.response.JsonResult;
import cn.tedu.apps_system.pojo.entity.Cart;
import cn.tedu.apps_system.service.CartService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "03.购物车模块")
@RestController
@RequestMapping("/api/v1/cart/")
public class CartController {
 @Autowired
 private CartService cartService;

 @ApiOperation("购物车添加功能")
 @ApiOperationSupport(order = 10)
 @PostMapping("public/cart_add")
 public JsonResult addCart(@RequestBody Cart cart)
 {
  return cartService.addCart(cart);
 }
}
